# this is a fence x=1:3000 y=sin(x/180) z=cos(y) scatterplot3js(x,y,z) x=1:3000 y=sin(x/180) z=cos(y)*y scatterplot3js(x,y,z) x=1:3000 y=sin(x/180) z=cos(y)*y* scatterplot3js(x,y,z) x=1:3000 y=sin(x/180) z=cos(y)*y**y scatterplot3js(x,y,z) x=1:600 y=sin(x/36) z=cos(x) scatterplot3js(x,y,z) x=1:600 y=sin(x/36) z=cos(x/36) scatterplot3js(x,y,z) # this is a spiral x=1:600 z=x*(sin(x/36))/100 y=x*(cos(x/36))/100 scatterplot3js(x,y,z) # this is a distorted spiral x=1:600 z=sin(x/36) y=x*(cos(x/36))/100 scatterplot3js(x,y,z) # this use th rgl package and demo a surface my_surface <- function(f, n=10, ...) { ranges <- rgl:::.getRanges() x <- seq(ranges$xlim[1], ranges$xlim[2], length=n) y <- seq(ranges$ylim[1], ranges$ylim[2], length=n) z <- outer(x,y,f) surface3d(x, y, z, ...) } library(rgl) f <- function(x1, x2) sin(x1) * x2 + x1 * x2 n <- 200 x1 <- 4*runif(n) x2 <- 4*runif(n) y <- f(x1, x2) + rnorm(n, sd=0.3) plot3d(x1,x2,y, type="p", col="red", xlab="X1", ylab="X2", zlab="Y", site=5, lwd=15) my_surface(f, alpha=.2 )